package com.example.demo.job;

import lombok.extern.slf4j.Slf4j;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * 滞纳金生成
 * <p>
 * 当账单预期未支付，则根据合同设置的滞纳金比例按日生成滞纳金
 * 用户支付账单总金额 = 账单金额 + 滞纳金 - 已付款金额
 * </p>
 *
 * @author Ethan Blake
 * @version 1.0
 * @since 2024/8/27
 */
@Slf4j
public class LateFeeJob implements Job {


    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        LocalDateTime now = LocalDateTime.now();
        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy年MM月dd日 HH:mm:ss");
        dateTimeFormatter.format(now);
        log.debug("Late Fee Job: {} ", dateTimeFormatter.format(now));
    }
}
